package com.yanjun.progress;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Title: Acceleration
 * Description:
 * Created DateTime: 2024-04-19
 * Created by xxl.
 */
public class Acceleration implements Parcelable {
    private double x;
    private double y;
    private double z;

    Acceleration() {

    }

    public Acceleration(double x, double y, double z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    protected Acceleration(Parcel in) {
        x = in.readDouble();
        y = in.readDouble();
        z = in.readDouble();
    }

    public static final Creator<Acceleration> CREATOR = new Creator<Acceleration>() {
        @Override
        public Acceleration createFromParcel(Parcel in) {
            return new Acceleration(in);
        }

        @Override
        public Acceleration[] newArray(int size) {
            return new Acceleration[size];
        }
    };

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    public double getZ() {
        return z;
    }

    public void setZ(double z) {
        this.z = z;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeDouble(x);
        parcel.writeDouble(y);
        parcel.writeDouble(z);
    }
}
